<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="pageContent">
	<form method="post" id="withdrawalsEditForm" action="${rootUrl}/member/withdrawals" class="pageForm required-validate" onsubmit="return validateCallback(this, editDialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
	 		<p>
				<label>会员名：</label>
				<input  type="text" size="30" value="${withdrawals.member.name}" readonly="readonly"/>
			</p>

			<p>
				<label>订单编号：</label>
				<input  type="text" size="30" value="${withdrawals.code}" readonly="readonly"/>
			</p>
			<p>
				<label>提现金额:</label>
				<input  type="text" size="30" value='<fmt:formatNumber value="${withdrawals.money/100}" pattern="0.00"/>' readonly="readonly"/>
			</p>
			<p>
				<label>银行名字：</label>
				<input  type="text" size="30" value="${withdrawals.bankcard.bank.name}" readonly="readonly"/>
			</p>
			<p>
				<label>银行卡号：</label>
				<input  type="text" size="30" value="${withdrawals.bankcard.bankCode}" readonly="readonly"/>
			</p>
			<p>
				<label>申请时间：</label>
				<input  type="text" size="30" value='<fmt:formatDate value="${withdrawals.createdAt}" pattern="yyyy-MM-dd HH:mm:ss" />' readonly="readonly"/>
			</p>
			<p>
				<label>支付时间：</label>
				<input  type="text" size="30" value='<fmt:formatDate value="${withdrawals.withdrawalsTime}" pattern="yyyy-MM-dd HH:mm:ss" />' readonly="readonly"/>
			</p>
			<p>
				<label>状态：</label>
				<c:if test="${withdrawals.state == 10}">
				<input  type="text" size="30" value="提现申请中" readonly="readonly"/>
				</c:if>
				
				<c:if test="${withdrawals.state == 11}">
				<input  type="text" size="30" value="提现成功" readonly="readonly"/>
				</c:if>
				
				<c:if test="${withdrawals.state == 12}">
				<input  type="text" size="30" value="提现失败" readonly="readonly"/>
				</c:if>
				
				<c:if test="${withdrawals.state != 12 && withdrawals.state != 11 && withdrawals.state != 10}">
				<input  type="text" size="30" value="其他" readonly="readonly"/>
				</c:if>
			</p>
			<p>
				<label>支付编码：</label>
					<c:if test="${withdrawals.state != 10}">
						<input type="text" size="30" value="${withdrawals.payCode}" readonly="readonly"/>
					</c:if>
					<c:if test="${withdrawals.state == 10}">
						<input name="withdrawals.payCode" type="text" size="30" value="${withdrawals.payCode}"/>
					</c:if>
			</p>
			<p></p>
			<p><label>回复内容：</label>
			<c:if test="${withdrawals.state == 10}">
			<textarea rows="5" cols="31" name="withdrawals.reply">${withdrawals.reply}</textarea>
			</c:if>
			<c:if test="${withdrawals.state != 10}">
			<textarea rows="5" cols="31" readonly="readonly">${withdrawals.reply}</textarea>
			</c:if>
			</p>
	</div>
	
		<div class="formBar">
			<ul>
				<c:if test="${withdrawals.state == 10 }">
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="withdrawalsSuccess(${withdrawals.id})" >提现成功</button></div></div></li>
				<li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="withdrawalsFail(${withdrawals.id});">提现失败</button></div></div></li>
				</c:if>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
					 
			</ul>
		</div>
	</form>
</div>
<script>
function withdrawalsSuccess(id){
	alertMsg.confirm("确认提现成功?",{
		okCall:function(){ 
			$("#withdrawalsEditForm").attr("action","${rootUrl}/member/withdrawals/"+id+"/withdrawalsSuccess");
			$("#withdrawalsEditForm").submit();
		}
	});
}
function withdrawalsFail(id){
	alertMsg.confirm("确定驳回请求?",{
		okCall:function(){ 
			$("#withdrawalsEditForm").attr("action","${rootUrl}/member/withdrawals/"+id+"/withdrawalsFail");
			$("#withdrawalsEditForm").submit();
		}
	});
}
</script>
